// 修改后的pages/index/index.ts
import {doLogin} from "../../utils/util"

Page({
  data: {
    cards: [
      {
        iconPath: 'https://wow.shuzhipeixian.com:12812/download/wow_collect/vote/sys/voteButtonIcon.jpg',
        title: '投票',
        desc: '发起投票',
        path: '/pages/vote/create_2/index',
        bgColor: '#2c3e50' // 深蓝色
      },
      {
        iconPath: 'https://wow.shuzhipeixian.com:12812/download/wow_collect/vote/sys/voteListButtonIcon.jpg',
        title: '我发起的投票',
        desc: '查看我发起的投票',
        path: '/pages/vote/list/index?searchType=1',
        bgColor: '#2c3e50' // 深蓝色
      },
      {
        iconPath: 'https://wow.shuzhipeixian.com:12812/download/wow_collect/vote/sys/voteListButtonIcon.jpg',
        title: '我参与的投票',
        desc: '查看我参与的投票',
        path: '/pages/vote/list/index?searchType=2',
        bgColor: '#2c3e50' // 深蓝色
      },
      {
        iconPath: 'https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/jinenggongvle.webp',
        title: '11.1副本资讯',
        desc: '最新赛季副本路线与打法',
        path: '/pages/game_instance/list/index',
        bgColor: '#2c3e50' // 深蓝色
      },
      {
        iconPath: 'https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/jinenggongvle.webp',
        title: '大秘境路线',
        desc: '飞天小女警大秘境路线',
        path: '/pages/game_instance/mdt/index',
        bgColor: '#34495e' // 稍浅的深蓝
      },
      {
        iconPath: 'https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/jinenggongvle.webp',
        title: '画图测试',
        desc: '',
        path: '/pages/canvas_test/index',
        bgColor: '#34495e' // 稍浅的深蓝
      },
      // {
      //   iconPath: '/images/loot-icon.png',
      //   title: '大秘境掉落',
      //   desc: '全副本装备掉落查询',
      //   path: '/pages/mythic-loot/mythic-loot',
      //   bgColor: '#34495e' // 稍浅的深蓝
      // },
      // {
      //   iconPath: '/images/talent-icon.png',
      //   title: '天赋模拟器',
      //   desc: '职业天赋配装模拟',
     
      //   path:'../talent_simulator/index/index',
      //   bgColor: '#16a085' // 蓝绿色
      // },W
      // {
      //   iconPath: '/images/raid-icon.png',
      //   title: '团队副本',
      //   desc: '史诗团本战术解析',
      //   path: '/pages/raid-guide/raid-guide',
      //   bgColor: '#c0392b' // 暗红色
      // }
    ] as CardItem[]
  },
   /**
  * 生命周期函数--监听页面加载
  */
 async onLoad(option: any) {
    await doLogin()
  },
  onCardTap(e: any) {
    console.log("跳转点击",e.currentTarget.dataset.path)
    const path = e.currentTarget.dataset.path;
    wx.navigateTo({
      url: path
    });
  }
});

interface CardItem {
  iconPath: string;
  title: string;
  desc: string;
  path: string;
  bgColor: string; // 新增背景色字段
}
